<template>
    <div class="home-hot">
        <div class="container">
            <div class="head">
                <h3>
                    {{ title }}<small>{{ subTitle }}</small>
                </h3>
            </div>
            <!-- 主体内容区域 -->
            <ul ref="hot" class="goods-list">
                <li v-for="item in list" :key="item.id">
                    <RouterLink to="/">
                        <img v-lazy="item.picture" alt="" style="width:306px;height:306px">
                        <p class="name">{{item.title}}</p>
                        <p class="desc">{{item.alt}}</p>
                    </RouterLink>
                </li>
            </ul>
        </div>
    </div>    
</template>
<script>
export default {
    name: 'HomeHot',
    data(){
        return {
            title:"人气推荐",
            subTitle:"人气爆款 不容错过",
            list:[],
            src:"../assets/loading.gif"
        }
    },
    async created() {
        let res = await this.$http.HotList();
        // console.log(res.data.result)
        this.list = res.data.result;
    },
}
</script>
  
<style scoped lang='scss'>
.home-hot{
    width: 100%;
    background-color: #fff;
    .head {
        padding: 40px 0;
        display: flex;
        align-items: flex-end;
        h3 {
            flex: 1;
            font-size: 32px;
            font-weight: normal;
            margin-left: 6px;
            height: 35px;
            line-height: 35px;
            small {
                font-size: 16px;
                color: #999;
                margin-left: 20px;
            }
        }
    }
    .goods-list {
        display: flex;
        justify-content: space-between;
        height: 426px;
        li {
            width: 306px;
            height: 406px;
            img {
                width: 306px;
                height: 306px;
            }
            p {
                font-size: 22px;
                padding-top: 12px;
                text-align: center;
            }
            .desc {
                color: #999;
                font-size: 18px;
            }
        }
    }
}
</style>